#!/bin/bash
# feraser.sh
#
# Deletes the file's contents preserving it

E_FILE=66  # File does not exist

# Check for file path
if [ -z $1 ]; then
	echo "Usage: $0 <PATH_TO_FILE>
	exit 1
fi

# Checking for file existance
if [ ! -f $1 ]; then
	echo "File $1 does not exist!"
	exit $E_FILE
fi

# File is now empty, but still exists
cat /dev/null > $1
